﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace TestEFAbstractEntity.Entities
{
    public class WorkNodeEvent
    {
        public Guid Id { get; set; }
        public string OtherMessage { get; set; }
        public virtual WorkNode WorkNode {get;set;}

        public void InitEvent()
        {
            WorkNode.OnEndApproval += WorkNode_OnEndApproval;
            WorkNode.OnEndReject += WorkNode_OnEndReject;
        }

        private void WorkNode_OnEndReject(WorkNode obj)
        {
            OtherMessage = "Reject";
            obj.Message.AppendLine("OnEndReject 事件输出：拒绝结束");
        }

        private void WorkNode_OnEndApproval(WorkNode obj)
        {
            OtherMessage = "Approval";
            obj.Message.AppendLine("OnEndApproval 事件输出：批准结束");
        }
    }
}
